package com.song.bloomfilter.controller;

import com.song.bloomfilter.domain.Products;
import com.song.bloomfilter.service.ProductsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;



@Api("布隆过滤器")
@RestController

public class GoodsController {
    @Autowired
    private  ProductsService productsService;


    @ApiOperation("根据id查询商品信息")
    @GetMapping("/goods/{id}")
    public Products queryGoods(@PathVariable Long id){
        return productsService.queryGoodsWithBloomFilter(id);
    }

    @ApiOperation("直接插入30条数据")
        @GetMapping("/insert")
    public void insert30(){
        productsService.insert30();
    }
}
